#define _CRT_SECURE_NO_DEPRECATE
#define _CRT_NONSTDC_NO_DEPRECATE
#include"DependencyWriter.h"
#include"CONLLWriter.h"
#include"MSTWriter.h"
using namespace std;

DependencyWriter::DependencyWriter(){
	labeled = false;
	hasEnd = false;
	writer = NULL;
}

DependencyWriter::~DependencyWriter(){}

DependencyWriter* DependencyWriter::createDependencyWriter(std::string &format, bool lb, bool hasEnd){
	if(format == "MST"){
		return new MSTWriter(lb, hasEnd);
	}
	else if(format == "CONLL"){
		return new CONLLWriter(lb, hasEnd);
	}
	else{
		cout<<"!!!!!!!  Not a supported format: "<<format<<endl;
		cout<<"********* Assuming CONLL format. **********"<<endl;
		return new CONLLWriter(lb, hasEnd);
	}
}

void DependencyWriter::startWriting(const char* file){
	writer = fopen(file, "w");
}

void DependencyWriter::finishWriting(){
	fclose(writer);
}

bool DependencyWriter::isLabeled(){
	return labeled;
}

void DependencyWriter::write(vector<string*> &forms, vector<string*> &lemma, vector<string*> &cpos, vector<string*> &pos, vector<string*> &labs, vector<int> &heads){}